//package com.coldlz.mmp.proxy;
//
//import com.coldlz.mmp.pojo.TemplatePublisher;
//import org.reactivestreams.Publisher;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.util.LinkedList;
//import java.util.List;
//import java.util.Map;
//import java.util.concurrent.ConcurrentHashMap;
//import java.util.concurrent.SubmissionPublisher;
//
//public class RecordContext {
//
//    public static final Logger log = LoggerFactory.getLogger(RecordContext.class);
//    public static final List<HttpRecord> recordsList = new LinkedList<>();
//    public static final Map<String, List<HttpRecord>> records = new ConcurrentHashMap<>();
//    static SubmissionPublisher<HttpRecord> recorder = new SubmissionPublisher<>();
//    static TemplatePublisher<HttpRecord> httpRecordPublisher = new TemplatePublisher<>(recorder);
//
//    private static List<HttpRecord> getRecords(String host) {
//        List<HttpRecord> objects = records.get(host);
//        if (objects == null) {
//            objects = new LinkedList<>();
//        }
//        records.put(host, objects);
//        return objects;
//    }
//
//    public static void addRecord(String host, HttpRecord record) {
//        List<HttpRecord> objects = RecordContext.getRecords(host);
//        objects.add(record);
//        recordsList.add(record);
//
//        recorder.submit(record);
//    }
//
//
//    public static Publisher<HttpRecord> getPublisher() {
//        return httpRecordPublisher;
//    }
//
//}
